<%--
 *  File:    DataUninstallDetail.jsp
 *  @Author: TerryCui
 *  Date:    2010/08/02
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>
<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.DataUninstallDetail"); 

	//init param
	String strModuleName = "CM";
	String privilegeCode = "ALL";
	String contextPath = request.getContextPath();
%>
<% //--------------------------------------  include files list --%>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>

<html>
<head>
<title>DataUninstallDetail</title>
<PageFlow:CheckPageFlow pageName="p_datauninstalldetail"/>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<%@ include file="/inc/SummaryDivision.inc" %>
<%
	Integer processtype = (Integer)pageContext.getAttribute("processtype");
	if(processtype == null)
		processtype = new Integer(-1234567);
	
	int ptype = processtype.intValue();
%>
<script>
function page_summary(actionvalue,orderbyname){
	var editform = summaryPrepare(cform,actionvalue,orderbyname);
	editform.action = "DataUninstallDetail.jsp?<%= OvalTools.randomURL() %>";
	editform.target = "_self";
	isRunning = true;
	editform.submit();  
}

function page_close(){
	window.close();
}
</script>
</head>
<body>
<% //--------------------------------------  page location --%>
<%@ include file="/inc/PageLocation.inc" %>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
<form name="cform" method="post" action="<%=contextPath %>/Dispatcher"  target="_self">
	<input type="hidden" name="pagename" value="p_datauninstalldetail">
	<input type="hidden" name="actionname">
	<custom:hidden property="processtype"/>
	<custom:hidden property="datafilepk"/>
   <tr>
    <td> 
      <table width="100%" border="0" cellspacing="0">  
         <tr>
          	<td class="td_left"><%= label.getLabelName("L_filename") + label.getLabelName("L_Colon") %></td>
            <td>
            	<custom:write property="filename" name="headinfo"/>
            </td>
         	<td class="td_left"><%= label.getLabelName("L_Partner") + label.getLabelName("L_Colon") %></td>
          	<td>
          		<custom:write property="shortname" name="headinfo"/>
            </td>
         </tr>
         <tr>
         	<td class="td_left" ><%= label.getLabelName("L_TimePeriod") + label.getLabelName("L_Colon") %></td>
            <td>
         		<custom:write property="startdate" name="headinfo"/>
         		-- 
         		<custom:write property="enddate" name="headinfo"/>
            </td>
         	<td class="td_right" >&nbsp;</td>
         	<td>&nbsp;</td>
         </tr>
       </table>
    </td>
  </tr>
  <tr>
    <td> 
      <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
         <tr  class="deepblue-left">
         	<%if(ptype == 10||ptype == 70){%>
            	<td width="*" class="title_center"><%= label.getLabelName("L_OriginCustomerName")%></td>
            <%}else if(ptype == 30){%>
            	<td width="*" class="title_center"><%= label.getLabelName("L_OriginVendorName")%></td>
            <%}%>
            <td width="10%" class="title_center"><%= label.getLabelName("L_ProdCode") %></td>
            <td width="20%" class="title_center"><%= label.getLabelName("L_ProdName") %></td>
            <td width="20%" class="title_center"><%= label.getLabelName("L_OriginProdName") %></td>
            <td width="5%" class="title_center"><%= label.getLabelName("L_Qty") %></td>
            <td width="10%" class="title_center"><%= label.getLabelName("L_Spec") %></td>
            <%if(ptype == 10||ptype == 70){%>
            	<td width="10%" class="title_center"><%= label.getLabelName("L_SalesDate") %></td>
            <%}else if (ptype == 20 || ptype==80){%>
            	<td width="10%" class="title_center"><%= label.getLabelName("L_InvDate") %></td>
            <%}else{%>
            	<td width="10%" class="title_center"><%= label.getLabelName("L_PurchaseDate") %></td>
            <%} %>
         </tr>
         <%
             int i = 0;
             String strClassType = new String(); 
             Vector totalsummary = (Vector)pageContext.getAttribute("totalsummary");
             if(totalsummary == null) totalsummary = new Vector();
          %>
          <logic:iterate id="summary" collection="<%= totalsummary %>">                      
         <%
            HashMap summaryMap = (HashMap)pageContext.getAttribute("summary");
            if(summaryMap == null) summaryMap = new HashMap();
            
            if(i%2 == 1){
              strClassType = "td-listrom";             
            }else{                    
              strClassType = "";
            }
              
            i++;     
          %>
           <tr onmouseover="this.className='tr-over'" onmouseout="this.className='<%=JspHelper.filterNull(strClassType)%>'" class="<%=JspHelper.filterNull(strClassType)%>">
           	<%if(ptype == 10||ptype == 70){%>
            	<td><custom:write property="custoriginame" name="summary"/></td>
            <%}else if(ptype == 30){%>
            	<td><custom:write property="vendororiginame" name="summary"/></td>
            <%}%>
            <td><custom:write property="prodcode" name="summary"/></td>
            <td><custom:write property="prdn" name="summary" nbsp="true"/></td>
            <td><custom:write property="originalprodname" name="summary" nbsp="true"/></td>
            <%if(ptype == 20 || ptype == 80){%>
            	<td><custom:write property="qtyall" name="summary" nbsp="true"/></td>
            <%}else{%>
            	<td><custom:write property="qty" name="summary" nbsp="true"/></td>
            <%}%>
            <td><custom:write property="itemspec" name="summary" nbsp="true"/></td>
            <td><custom:write property="startdate" name="summary" nbsp="true" dataType="date" dataFormat="yyyy-MM-dd"/></td>
            
          </tr>
          </logic:iterate>
      <% //--------------------------------------  flipping page --%>
      <%@ include file="/inc/SummaryAction.inc" %>
      </table>
            <table width="100%" cellspacing="0" cellpadding="0">
        <tr> 
          <td class="summary_top"></td>
        </tr>
        <tr> 
          <td class="td_center">
            <a onclick="page_close();"><custom:button type="1" label="L_Close" imgsrc="edit.gif" border="0" style="width:80"/></a>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  </form>
</table>
</body>
</html>